import java.util.*;
// DFS, recursion
public class palindrome {
  public static ArrayList<ArrayList<String>> partition(String s) {
    // Start typing your Java solution below
    // DO NOT write main() function
    ArrayList<ArrayList<String>> res = new ArrayList<ArrayList<String>>();
    helper(res, new ArrayList<String>(), s);
    return res;
  }
  public static void helper(ArrayList<ArrayList<String>> res, ArrayList<String>buff, String s){
    if(s.length()==0) {
      res.add(buff);
      return;
    }
    for(int i =1;i<=s.length();i++){
      String str = s.substring(0,i);
      if(isPali(str)){
        ArrayList<String>nbuff =new ArrayList<String>(buff);
        nbuff.add(str);
        helper(res, nbuff,s.substring(i));
      }
    }
  }
  public static boolean isPali(String s){
    int i = 0,j=s.length()-1;
    while(i<j)
      if(s.charAt(i++)!=s.charAt(j--)) return false;
    return true;
  }
  
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    while (scanner.hasNext()) {
      String curLine = scanner.next();
      // System.out.println("Is " + curLine + " palidrome? " + isPalindrome(curLine));
      System.out.println(partition(curLine));
    }
  }
}